$(document).ready(function() {
    $("[data-toggle='popover']").popover({
        template: '<div class="popover" role="tooltip"><div class="arrow"></div><div class="popover-content"></div><h3 class="popover-title" style="border-bottom:none;"></h3></div>',
        trigger:"hover",
        delay: {hide: 100},
        placement: "right",
        html: true,
        container: 'body',
        content: 'Copyright &copy; bookpop.top All Rights Reserved.'
    })
})
function randomNum(minNum,maxNum){
    switch(arguments.length){
        case 1:
            return parseInt(Math.random()*minNum+1,10);
            break;
        case 2:
            return parseInt(Math.random()*(maxNum-minNum+1)+minNum,10);
            break;
        default:
            return 0;
            break;
    }
}
var showTime = new Vue({
    el: "#nowtime",
    data:{
        date: new Date().toLocaleDateString()+'  '+new Date().toLocaleTimeString()
    },
    mounted: function (){
        var _this = this;
        this.timer = setInterval(function (){
            _this.date = new Date().toLocaleDateString()+'  '+new Date().toLocaleTimeString();
        },1000);
    },
    beforeDestory: function(){
        if(this.timer){
            clearInterval(this.timer)
        }
    }
});

var randomBGVideo = new Vue({
    el:"#bg-video-source",
    data:{
        bgVideoSrc:""
    },
    mounted:function (){
        let num = randomNum(0,2);
        this.bgVideoSrc = "../res/video/bg-video"+num+".mp4";
    }
})
